// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package edu.uwlax.cs.oayonlinestore.entities;

/**
 * @see edu.uwlax.cs.oayonlinestore.entities.GiftCard
 */
public class GiftCardImpl extends edu.uwlax.cs.oayonlinestore.entities.GiftCard {
	private final static int[] lAlphabet = { 65, 66, 67, 68, 69, 70, 71, 72,
			73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
			90 };// character captical

	private final static int[] number = { 48, 49, 50, 51, 52, 53, 54, 55, 56,
			57 };// number

	private static final long serialVersionUID = -2076474525825378723L;

	public String generateCardID() {
		java.util.Random rd = new java.util.Random();
		StringBuffer r = new StringBuffer();
		for (int j = 0; j < 16; j++) {
			switch (rd.nextInt(2)) {
			case 0:
				r.append((char) number[rd.nextInt(number.length)]);
				break;
			case 1:
				r.append((char) lAlphabet[rd.nextInt(lAlphabet.length)]);
				break;
			}
		}
		return r.toString();
	}

}